package com.lvmama.pangolin.service.impl.configImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lvmama.pangolin.entity.Config;
import com.lvmama.pangolin.entity.ConfigListConditionVO;
import com.lvmama.pangolin.entity.LogListConditionVO;
import com.lvmama.pangolin.entity.LogVO;
import com.lvmama.pangolin.mybatis.mapper.config.BackConfigMapper;
import com.lvmama.pangolin.service.config.BackConfigService;

@Transactional
@Service
public class BackConfigServiceImpl implements BackConfigService{
	/**   
	* @Title: LogServiceImpl.java  
	* @Description: TODO(用一句话描述该文件做什么) 
	* @author caobo 
	* @date 2017年0227
	*/
	@Autowired
	private BackConfigMapper backConfigMapper;

	@Override
	public PageInfo<LogVO> getLogList(LogListConditionVO logListConditionVO) throws Exception {
		 PageHelper.startPage(logListConditionVO.getPage(), logListConditionVO.getPageSize());
		 List<LogVO> logVoList = backConfigMapper.getLogList(logListConditionVO);
		 PageInfo<LogVO> page = new PageInfo<LogVO>(logVoList);
	     return page;
	 }

	@Override
	public PageInfo<Config> getConfigList(ConfigListConditionVO configListConditionVO) throws Exception {
		 PageHelper.startPage(configListConditionVO.getPage(), configListConditionVO.getPageSize());
		 List<Config> configVoList = backConfigMapper.getConfigList(configListConditionVO);
		 PageInfo<Config> page = new PageInfo<Config>(configVoList);
	     return page;
	}

	@Override
	public List<Config> getConfigByIds(Config config) throws Exception {
		 List<Config> configVoList = backConfigMapper.getConfigByIds(config);
	     return configVoList;
	}

	@Override
	public void insertConfig(Config config) throws Exception {
		backConfigMapper.insertConfig(config);
		
	}

	@Override
	public void deleteConfig(Config config) throws Exception {
		backConfigMapper.deleteConfig(config);
		
	}

	@Override
	public void updateConfig(Config config) throws Exception {
		backConfigMapper.updateConfig(config);
	}

	@Override
	public LogVO getLogByIds(LogVO logVO) throws Exception {
		return backConfigMapper.getLogByID(logVO);
	}
	
   }
